package io.renren.modules.shipping.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.shipping.dao.V9ShippingDao;
import io.renren.modules.shipping.entity.V9ShippingEntity;
import io.renren.modules.shipping.service.V9ShippingService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("v9ShippingService")
public class V9ShippingServiceImpl extends ServiceImpl<V9ShippingDao, V9ShippingEntity> implements V9ShippingService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
		String shipping_name = (String)params.get("shipping_name");
        IPage<V9ShippingEntity> page = this.page(
                new Query<V9ShippingEntity>().getPage(params,"listorder",false),
                new QueryWrapper<V9ShippingEntity>().like(StringUtils.isNotBlank(shipping_name),"shipping_name", "%"+shipping_name+"%")
        );

        return new PageUtils(page);
    }


	@Override
	public void updateListorder(Map<String, Object> params) {
		Integer shippingId=Integer.parseInt((String)params.get("shippingId"));
		Integer listorder=Integer.parseInt((String)params.get("listorder"));
    	V9ShippingEntity shipping=new V9ShippingEntity();
    	shipping.setShippingId(shippingId);
     	}


}
